Optimal. Leaf size=34 \[ -\frac{a^2 x^{-2 n}}{2 n}-\frac{2 a b x^{-n}}{n}+b^2 \log (x) \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.0159883, antiderivative size = 34, normalized size of antiderivative = 1., number of steps used = 3, number of rules used = 2, integrand size = 17, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.118, Rules used = {266, 43} \[ -\frac{a^2 x^{-2 n}}{2 n}-\frac{2 a b x^{-n}}{n}+b^2 \log (x) \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 266
Rule 43
Rubi steps
\begin{align*} \int x^{-1-2 n} \left (a+b x^n\right )^2 \, dx &=\frac{\operatorname{Subst}\left (\int \frac{(a+b x)^2}{x^3} \, dx,x,x^n\right )}{n}\\ &=\frac{\operatorname{Subst}\left (\int \left (\frac{a^2}{x^3}+\frac{2 a b}{x^2}+\frac{b^2}{x}\right ) \, dx,x,x^n\right )}{n}\\ &=-\frac{a^2 x^{-2 n}}{2 n}-\frac{2 a b x^{-n}}{n}+b^2 \log (x)\\ \end{align*}
Mathematica [A] time = 0.0272676, size = 28, normalized size = 0.82 \[ b^2 \log (x)-\frac{a x^{-2 n} \left (a+4 b x^n\right )}{2 n} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A] time = 0.012, size = 43, normalized size = 1.3 \begin{align*}{\frac{1}{ \left ({{\rm e}^{n\ln \left ( x \right ) }} \right ) ^{2}} \left ({b}^{2}\ln \left ( x \right ) \left ({{\rm e}^{n\ln \left ( x \right ) }} \right ) ^{2}-{\frac{{a}^{2}}{2\,n}}-2\,{\frac{a{{\rm e}^{n\ln \left ( x \right ) }}b}{n}} \right ) } \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [F(-2)] time = 0., size = 0, normalized size = 0. \begin{align*} \text{Exception raised: ValueError} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A] time = 1.20478, size = 81, normalized size = 2.38 \begin{align*} \frac{2 \, b^{2} n x^{2 \, n} \log \left (x\right ) - 4 \, a b x^{n} - a^{2}}{2 \, n x^{2 \, n}} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [A] time = 74.7313, size = 235, normalized size = 6.91 \begin{align*} \begin{cases} a^{2} x + 4 a b \sqrt{x} + b^{2} \log{\left (x \right )} & \text{for}\: n = - \frac{1}{2} \\\left (a + b\right )^{2} \log{\left (x \right )} & \text{for}\: n = 0 \\- \frac{2 a^{2} n}{4 n^{2} x^{2 n} + 2 n x^{2 n}} - \frac{a^{2}}{4 n^{2} x^{2 n} + 2 n x^{2 n}} - \frac{8 a b n x^{n}}{4 n^{2} x^{2 n} + 2 n x^{2 n}} - \frac{4 a b x^{n}}{4 n^{2} x^{2 n} + 2 n x^{2 n}} + \frac{4 b^{2} n^{2} x^{2 n} \log{\left (x \right )}}{4 n^{2} x^{2 n} + 2 n x^{2 n}} + \frac{2 b^{2} n x^{2 n} \log{\left (x \right )}}{4 n^{2} x^{2 n} + 2 n x^{2 n}} + \frac{2 b^{2} n x^{2 n}}{4 n^{2} x^{2 n} + 2 n x^{2 n}} & \text{otherwise} \end{cases} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A] time = 1.22043, size = 51, normalized size = 1.5 \begin{align*} \frac{2 \, b^{2} n x^{2 \, n} \log \left (x\right ) - 4 \, a b x^{n} - a^{2}}{2 \, n x^{2 \, n}} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]